// directives/permission.js
import { useUserInfoStore } from '@/stores/userInfo';

export default {
    mounted(el, binding) {
        const store = useUserInfoStore();
        const permission = binding.value;
        if (!store.permissions.includes(permission)) {
            console.log('权限缺失:', permission);
            el.parentNode?.removeChild(el);
        }
    },
};